from django.db import models

# Create your models here.

class DepartmentModel(models.Model):
    name=models.CharField(max_length=30)

    def __str__(self):
        return self.name


class UserModel(models.Model):
    username=models.CharField(max_length=30)
    password=models.CharField(max_length=128)
    authority=models.CharField(max_length=30,verbose_name='权限字段')
    department = models.ForeignKey(DepartmentModel, on_delete=models.CASCADE,null=True,blank=True)

    def __str__(self):
        return self.username
